import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '首页',
      component: HomeView,
    },
    {
      path: '/usercenter',
      name: '用户中心',
      component:  ()=>import('../views/UserCenterView.vue')
    },
    {
      path: '/resource',
      name: '资源池',
      component: ()=>import('../views/ResourceView.vue')
    },
    {
      path: '/demond',
      name: '需求池',
      component: ()=>import('../views/DemondView.vue')
    },
    {
      path: '/talent',
      name: '专家服务',
      component: ()=>import('../views/TalentView.vue')
    },
    {
      path: '/organization',
      name: '机构清单',
      component: ()=>import('../views/OrganizationView.vue'),
      children:[
        {
          path:':id',
          name:'机构主页',
          component:()=>import('../views/organization/OrganizationHome.vue')
        }
      ]
    },
    {
      path: '/information',
      name: '资讯窗口',
      component: ()=>import('../views/InformationView.vue')
    },
    {
      path: '/manage',
      name: '管理入口',
      component: ()=>import('../views/ManageView.vue'),
      children:[
        {
          path:'user/notifications',
          name: '通知',
          component: ()=>import('../views/manage/NotificationsView.vue')
        },
        {
          path: 'auditor/talent',
          name: '专家审核',
          component: ()=>import('../views/manage/AuditorTalentView.vue')
        },
      ]
    },
    {
      path:'/:pathMatch(.*)',
      name:'404',
      component:()=>import('@/views/404.vue')
    }
  ]
})

export default router
